
<!DOCTYPE html>
<html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <meta name="author" content="Alexander Barth">

   <title>matplot: scatter</title>
   <link href="style.css" rel="stylesheet" type="text/css" />
   <link href="prettify/prettify.css" type="text/css" rel="stylesheet" />
   <script type="text/javascript" src="prettify/prettify.js"></script>
   <script type="text/javascript" src="numeric-1.2.3.js"></script>
   <link href="../matplot.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="matplot.js"></script>


   <script type="text/javascript">
function init() {      
  
var i,x=[],y=[],c=[];
  

// generate some data to plot
// generate some data to plot
for (i=0; i < 100; i++) {

    r = 20 + 5*i;
    theta = 2*Math.PI * i/25;
    x[i] = r*Math.cos(theta);
    y[i] = r*Math.sin(theta);
    c[i] = r;
  
}

fig = new matplot.Figure("plot",700,500);
ax = fig.axes();
ax.scatter(x,y,5,c);
ax.DataAspectRatio([1,1,1]);
ax.colorbar();

fig.draw();

}

addEventListener('load', function (event) { prettyPrint() }, false);

    </script>
 </head>
    <body onload="init()">
    <h1>matplot: scatter</h1>
    <p>2D scatter plot (function scatter)</p>
    <div id="plot"></div>
    <h2>Code:</h2>
    <pre class=prettyprint>

var i,x=[],y=[],c=[];
  

// generate some data to plot
// generate some data to plot
for (i=0; i &lt; 100; i++) {

    r = 20 + 5*i;
    theta = 2*Math.PI * i/25;
    x[i] = r*Math.cos(theta);
    y[i] = r*Math.sin(theta);
    c[i] = r;
  
}

fig = new matplot.Figure("plot",700,500);
ax = fig.axes();
ax.scatter(x,y,5,c);
ax.DataAspectRatio([1,1,1]);
ax.colorbar();

fig.draw();

    </pre>    
  </body>
</html>
